﻿@model Source.ViewModels.List_SanPham

@{
    ViewBag.Title = "Index";
}

@using System.Drawing


<script type="text/javascript">

    function isNumberKey(evt) {

        var charCode = (evt.which) ? evt.which : event.keyCode
        if (charCode > 31 && (charCode < 48 || charCode > 57)) {
            return false;
        }
        return true;
    }
  </script>
<span style="color:#E9DA95;
	padding-left:30px;
	background-image:url('../../Images/Common/nensf.png');
	font-size:20px;display:block"> @Model.Title</span>
    <div style="margin-top:30px">
@foreach (var m in Model.lstSP)
{
    using (Html.BeginForm("addToCart", "Cart", FormMethod.Get))
    {
    <table style="float:left;margin-right:30px;margin-left:50px;color:#A28930;">
        <tr>
            <td> 
                <a href=/ProductDetails/index/?MaSP=@m.MaSP ><img src="data:image/jpg;base64,@(Convert.ToBase64String(m.HinhAnh))" style="border-style: solid;
border-color: #643112;
border-width: 6px;
position: relative;" height="120px" width="120px"  alt="" /></a>
            </td>
         <tr>
           <tr>  <td>  <span style="font-size:13px">Tên : @m.TenSP</span></td> <tr>
           <tr>  <td><span style="color: orange;font-size:13px">Giá : @m.DonGia</span></td> </tr>
           <tr>
               <td>
                    <input type="text" id="txt_SL" name="txt_sl" value="1" style="width:50px;" onkeypress="return isNumberKey(event)"/>
                    <input type="hidden" name="MaSP" value="@m.MaSP" />
                    <input id="addToCart" type="submit" value="Mua" style="background-color: #E9DA95;color: #8A4A22;" />
               </td>
           </tr>
        </tr>       
    </table>
    }
}
</div>